home *** CD-ROM | disk | FTP | other *** search
- /*
- File: BlockStorage.h
-
- Contains: External interfaces to Block Storage Family
-
- Version: Technology: Copland
- Release: Universal Interfaces 3.0d3 on Copland DR1
-
- Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
-
- Bugs?: If you find a problem with this file, send the file and version
- information (from above) and the problem description to:
-
- Internet: apple.bugs@applelink.apple.com
- AppleLink: APPLE.BUGS
-
- */
- #ifndef __BLOCKSTORAGE__
- #define __BLOCKSTORAGE__
-
- #ifndef __TYPES__
- #include <Types.h>
- #endif
- #ifndef __MATH64__
- #include <Math64.h>
- #endif
- #ifndef __ERRORS__
- #include <Errors.h>
- #endif
- #ifndef __NAMEREGISTRY__
- #include <NameRegistry.h>
- #endif
- #ifndef __IOMEMORYLISTS__
- #include <IOMemoryLists.h>
- #endif
- #ifndef __IOITERATOR__
- #include <IOIterator.h>
- #endif
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import on
- #endif
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=power
- /* the following contents can only be used by compilers that support PowerPC struct alignment */
-
- #if FOR_SYSTEM8_PREEMPTIVE
- /*
- ******************************************************************************
- *******************************************************************************
- *******************************************************************************
-
- Block Storage Constants
-
- *******************************************************************************
- *******************************************************************************
- *****************************************************************************
- */
- /*
- ******************************************************************************
-
- Store property names
-
- *****************************************************************************
- */
- #define kBlockStorageStoreID "Id"
- #define kBlockStorageStoreSize "BSStoreSize"
- #define kBlockStorageStoreReadBlockSize "BSStoreReadBlockSize"
- #define kBlockStorageStoreWriteBlockSize "BSStoreWriteBlockSize"
- #define kBlockStorageStoreContainer "BSStoreContainer"
- #define kBlockStorageStoreParent "BSStoreParent"
- #define kBlockStorageStoreType "BSStoreType"
- #define kBlockStorageStoreDevice "BSStoreDevice"
- #define kBlockStorageEjectable "BSStoreEjectable"
- #define kBlockStorageBootDevice "BSStoreBootDevice"
- #define kBlockStorageWritable "BSStoreWritable"
- #define kBlockStorageMappingPlugIn "BSStoreMappingPlugIn"
- #define kBlockStoragePartitioningPlugIn "BSStorePartitioningPlugIn"
- /*
- ******************************************************************************
-
- Container property names
-
- *****************************************************************************
- */
- #define kBlockStorageContainerParent "BSStoreParent"
- #define kBlockStorageContainerType "BSStoreType"
- #define kBlockStorageEjectable "BSStoreEjectable"
- #define kBlockStorageContainerPlugIn "BSStoreContainerPlugIn"
- /*
- ******************************************************************************
-
- StoreOpenOptions is the set of permissions available when making a Connection
- to a Store. These options can be OR'd together in any combination.
-
- *****************************************************************************
- */
-
- enum {
- kBSStoreRead = 0x00000001, /* Allow reading/positioning */
- kBSStoreWrite = 0x00000002, /* Allow writing */
- kBSStoreExclusiveIO = 0x00000004, /* Don't allow another IO Connection to be opened */
- kBSStoreExclusiveCntrl = 0x00000008, /* Don't allow another control Connection to be opened */
- kBSStoreResizeOK = 0x00000010, /* Resizing of the Store is OK (but, of course, notify me) */
- kBSStoreControl = 0x00000020 /* Allow me to control the Store */
- };
-
- typedef UInt32 BSStoreOpenOptions;
- /*
- ******************************************************************************
-
- BSContainerOpenOptions is the set of permissions available when making a
- Connection to a Container. These options can be OR'd together in any combination.
-
- *****************************************************************************
- */
-
- enum {
- kBSContainerExclusiveCntrl = 0x00000001 /* Don't allow another Connection to be opened */
- };
-
- typedef UInt32 BSContainerOpenOptions;
- /*
- ****************************************************************************
-
- Accessibility states
-
- Accessibility States indicate how accessible a Block Storage Container or
- Store is. There are four currently defined. Their absolute values
- are unimportant, but have been split across fairly large ranges to
- allow for future values to be inserted between them.
-
- kBSOnline and kBSOffline represent the two extremes of accessibility -
- nothing can be less accessible than kBSOffline (that is the state you
- send a Store to when you are about to delete it) and nothing can be
- more online than kBSOnline, which means you are fully, 100% available.
-
- ***************************************************************************
- */
-
- enum {
- kBSOnline = 0x0FFFFFFF,
- kBSPowerSave = 0x0A000000,
- kBSOutOfDrive = 0x01000000,
- kBSOffline = 0
- };
-
- typedef UInt32 BSAccessibilityState;
- /*
- ****************************************************************************
-
- Component types
-
- ***************************************************************************
- */
-
- enum {
- kBSExternalDeviceComponent = 1,
- kBSStoreComponent = 2
- };
-
- typedef UInt32 BSComponentType;
- /*
- ****************************************************************************
-
- Block List Seek specifiers
-
- ***************************************************************************
- */
-
- enum {
- kBSBlockListSeekByteAbsolute = 1,
- kBSBlockListSeekByteRelative = 2,
- kBSBlockListSeekExtentAbsolute = 3,
- kBSBlockListSeekExtentRelative = 4,
- kBSBlockListSeekBlockAbsolute = 5,
- kBSBlockListSeekBlockRelative = 6
- };
-
- typedef UInt32 BSBlockListWhence;
- /*
- ****************************************************************************
-
- Selectors for BSStoreGetDeviceData - specifies which set of Stores to
- return
-
- ***************************************************************************
- */
-
- enum {
- kBSStoreGetLeafStores = 1,
- kBSStoreGetAllStores = 2,
- kBSStoreGetPrimaryStores = 3
- };
-
- typedef UInt32 BSStoreGetSelector;
- /*
- ****************************************************************************
-
- Format specifiers - these are generic categories. There may be further
- distinctions within these categories for number of blocks, etc.
-
- ***************************************************************************
- */
-
- enum {
- kBSFormatFloppyGCR = 'gcr ',
- kBSFormatFloppyMFM = 'mfm ',
- kBSFormatSCSI = 'scsi',
- kBSFormatATA = 'ata ',
- kBSNotFormatable = 'none'
- };
-
- typedef OSType BSStoreFormatType;
-
- enum {
- kBSMaxFormats = 8
- };
-
- /* Maximum number of formats a Mapping plug-in can support */
- /*
- ****************************************************************************
- *****************************************************************************
- *****************************************************************************
-
- Block Storage Error codes
-
- *****************************************************************************
- *****************************************************************************
- ***************************************************************************
- */
- /*
- ****************************************************************************
-
- Basic error types
-
- ***************************************************************************
- */
-
- enum {
- E_Success = 0x00000000,
- E_LoopTermination = 0x08000000,
- E_Underflow = 0x10000000,
- E_Overflow = 0x18000000,
- E_AlreadyExists = 0x20000000,
- E_NotFound = 0x28000000,
- E_AccessViolation = 0x30000000,
- E_Busy = 0x38000000,
- E_VersionMismatch = 0x40000000,
- E_Canceled = 0x48000000,
- E_OutOfResources = 0x50000000,
- E_Timeout = 0x58000000,
- E_ParameterError = 0x60000000,
- E_Fatal = 0x68000000,
- E_Unknown = 0xF8000000
- };
-
- /*
- ****************************************************************************
-
- Block Storage Error ID
-
- ***************************************************************************
- */
-
- enum {
- E_BlockStorageBias = 0x04F00000
- };
-
- /*
- ****************************************************************************
-
- Block Storage Error Categories
-
- ***************************************************************************
- */
-
- enum {
- E_BSFamilyError = 0x00000000 | E_BlockStorageBias,
- E_BSExpertError = 0x00008000 | E_BlockStorageBias,
- E_BSMappingPlugInError = 0x00010000 | E_BlockStorageBias,
- E_BSPartitioningPlugInError = 0x00018000 | E_BlockStorageBias,
- E_BSContainerPlugInError = 0x00020000 | E_BlockStorageBias,
- E_BSBlockListError = 0x00028000 | E_BlockStorageBias,
- E_BSSuccess = E_Success
- };
-
- /*
- ****************************************************************************
-
- Family Errors
-
- ***************************************************************************
- */
-
- enum {
- E_BSOutOfResources = 0x00000001 | E_OutOfResources | E_BSFamilyError,
- E_BSStoreInUse = 0x00000001 | E_AccessViolation | E_BSFamilyError,
- E_BSStoreWriteProtected = 0x00000002 | E_AccessViolation | E_BSFamilyError,
- E_BSStoreNotFound = 0x00000001 | E_NotFound | E_BSFamilyError,
- E_BSBadMessage = 0x00000001 | E_ParameterError | E_BSFamilyError,
- E_BSBadConnection = 0x00000002 | E_ParameterError | E_BSFamilyError,
- E_BSTableTooSmall = 0x00000003 | E_ParameterError | E_BSFamilyError,
- E_BSNullParameters = 0x00000004 | E_ParameterError | E_BSFamilyError,
- E_BSParameterError = 0x00000005 | E_ParameterError | E_BSFamilyError,
- E_BSUnimplemented = 0x00000001 | E_VersionMismatch | E_BSFamilyError
- };
-
- /*
- ****************************************************************************
-
- Expert Errors
-
- ***************************************************************************
- */
-
- enum {
- E_BSEPlugInNotFound = 0x00000001 | E_NotFound | E_BSExpertError,
- E_BSENoPlugInMatch = 0x00000002 | E_NotFound | E_BSExpertError,
- E_BSENoMoreStores = 0x00000001 | E_OutOfResources | E_BSExpertError,
- E_BSEHierarchyTooDeep = 0x00000002 | E_OutOfResources | E_BSExpertError,
- E_BSEOutOfResources = 0x00000003 | E_OutOfResources | E_BSExpertError
- };
-
- /*
- ****************************************************************************
-
- Mapping Plug-in Errors
-
- ***************************************************************************
- */
-
- enum {
- E_BSMPIOutOfStoreBounds = 0x00000001 | E_ParameterError | E_BSMappingPlugInError,
- E_BSMPITooManyMappings = 0x00000002 | E_ParameterError | E_BSMappingPlugInError,
- E_BSMPIBadMappingParams = 0x00000003 | E_ParameterError | E_BSMappingPlugInError,
- E_BSMPIMappingNotSupported = 0x00000004 | E_ParameterError | E_BSMappingPlugInError,
- E_BSMPIStateNotSupported = 0x00000005 | E_ParameterError | E_BSMappingPlugInError,
- E_BSMPIWriteProtected = 0x00000001 | E_AccessViolation | E_BSMappingPlugInError,
- E_BSMPICannotGoToState = 0x00000002 | E_AccessViolation | E_BSMappingPlugInError,
- E_BSMPIUnitNotResponding = 0x00000001 | E_Fatal | E_BSMappingPlugInError,
- E_BSMPITransferError = 0x00000002 | E_Fatal | E_BSMappingPlugInError,
- E_BSMPIMemoryAccessFault = 0x00000003 | E_Fatal | E_BSMappingPlugInError,
- E_BSMPINoPlugIn = 0x00000004 | E_Fatal | E_BSMappingPlugInError,
- E_BSMPIMediaRemoved = 0x00000005 | E_Fatal | E_BSMappingPlugInError,
- E_BSMPIOutOfResources = 0x00000001 | E_OutOfResources | E_BSMappingPlugInError
- };
-
- /*
- ****************************************************************************
-
- Partitioning Plug-in Errors
-
- ***************************************************************************
- */
-
- enum {
- E_BSPPIMappingNotSupported = 0x00000001 | E_ParameterError | E_BSPartitioningPlugInError,
- E_BSPPIOverlappingPartition = 0x00000002 | E_ParameterError | E_BSPartitioningPlugInError,
- E_BSPPIOutOfStoreBounds = 0x00000003 | E_ParameterError | E_BSPartitioningPlugInError,
- E_BSPPIPartitionNonExistant = 0x00000004 | E_ParameterError | E_BSPartitioningPlugInError,
- E_BSPPITooManyPartitions = 0x00000005 | E_ParameterError | E_BSPartitioningPlugInError,
- E_BSPPINoPlugIn = 0x00000001 | E_Fatal | E_BSPartitioningPlugInError,
- E_BSPPIOutOfResources = 0x00000002 | E_OutOfResources | E_BSPartitioningPlugInError
- };
-
- /*
- ****************************************************************************
-
- Container Plug-in Errors
-
- ***************************************************************************
- */
- /*
- ****************************************************************************
-
- Block List Errors
-
- ***************************************************************************
- */
-
- enum {
- E_BSBLEndOfList = 0x00000001 | E_Underflow | E_BSBlockListError,
- E_BSBLParameterError = 0x00000001 | E_ParameterError | E_BSBlockListError,
- E_BSBLBadBlockList = 0x00000002 | E_ParameterError | E_BSBlockListError,
- E_BSBLBadBlock = 0x00000003 | E_ParameterError | E_BSBlockListError,
- E_BSBLAlreadyFinalized = 0x00000001 | E_AlreadyExists | E_BSBlockListError,
- E_BSBLOutOfResources = 0x00000001 | E_OutOfResources | E_BSBlockListError
- };
-
- /*
- ****************************************************************************
- *****************************************************************************
- *****************************************************************************
-
- Block Storage Types and Structures
-
- *****************************************************************************
- *****************************************************************************
- ***************************************************************************
- */
- /*
- ****************************************************************************
-
- Store and Container Persistent Identifiers
-
- ***************************************************************************
- */
- typedef char BSStoreID[12];
- typedef char BSContainerID[12];
- /*
- ****************************************************************************
-
- Connection ID's
-
- ***************************************************************************
- */
- typedef ObjectID BSContainerConnID;
- typedef ObjectID BSStoreConnID;
- /*
- ****************************************************************************
-
- Plug-in run-time references. References the plug-in in general, not
- a specific instance of it
-
- ***************************************************************************
- */
- typedef struct OpaqueBSMappingPlugInRef* BSMappingPlugInRef;
- typedef struct OpaqueBSPartitioningPlugInRef* BSPartitioningPlugInRef;
- typedef struct OpaqueBSContainerPlugInRef* BSContainerPlugInRef;
- /*
- ****************************************************************************
-
- Store and Container Run-Time References
-
- ***************************************************************************
- */
- typedef RegEntryRef BSStoreRef;
- typedef RegEntryRef BSContainerRef;
- /*
- ****************************************************************************
-
- Store and Container Navigation API types
-
- ***************************************************************************
- */
- typedef ObjectID BSStoreIteratorID;
- typedef ObjectID BSContainerIteratorID;
- typedef RegPropertyInstance BSStorePropertyInstance;
- typedef RegPropertyInstance BSContainerPropertyInstance;
- /*
- ****************************************************************************
-
- Device block descriptor types
-
- ***************************************************************************
- */
- typedef UInt64 BSByteCount;
- typedef struct OpaqueBSBlockListRef* BSBlockListRef;
- typedef struct OpaqueBSBlockListDescriptorRef* BSBlockListDescriptorRef;
- /*
- ******************************************************************************
-
- BSBlockListDescriptorInfo - information about a Block List Descriptor
-
- *****************************************************************************
- */
- struct BSBlockListDescriptorInfo {
- BSByteCount bias;
- BSByteCount start;
- UInt32 length;
- BSBlockListDescriptorRef parentDescriptor;
- BSBlockListRef parentList;
- };
- typedef struct BSBlockListDescriptorInfo BSBlockListDescriptorInfo;
-
- typedef BSBlockListDescriptorInfo *BSBlockListDescriptorInfoPtr;
- /*
- ****************************************************************************
-
- BSStoreFormatInfo
-
- ***************************************************************************
- */
- typedef ItemCount BSFormatIndex;
- struct BSStoreFormatInfo {
- BSStoreFormatType formatType;
- BSByteCount formatSize;
- BSFormatIndex formatNum; /* Format identifier - specific to Mapping plug-in */
- };
- typedef struct BSStoreFormatInfo BSStoreFormatInfo;
-
- /*
- ****************************************************************************
-
- BSStoreInfo is used to return information about a Store
-
- ***************************************************************************
- */
- struct BSStoreInfo {
- BSStoreID storeID;
- BSByteCount storeSize;
- BSByteCount readBlockSize; /* minimum read size & granularity */
- BSByteCount writeBlockSize; /* minimum write size & granularity */
- BSContainerRef container; /* the container containing this Store */
- ItemCount numChildren;
- ItemCount numParents;
-
- ItemCount numPartitions; /* Number of partitions in use */
- ItemCount maxPartitions; /* Maximum number of partitions possible */
-
- Boolean isPartitioned; /* True if a partitioning plug-in is associated with this Store */
-
- Boolean isEjectable;
- Boolean isBootDevice;
- Boolean isWriteable;
- Boolean hasAutoEjectHardware;
- Boolean isFormattable;
-
- Boolean isPartitionable;
- Boolean isFilesystem;
-
- BSMappingPlugInRef mappingPlugIn;
- BSPartitioningPlugInRef partitioningPlugIn;
-
- BSStoreFormatInfo curFormat;
-
- BSStoreFormatInfo possibleFormats[8];
-
- Str255 name; /* Max name size is 255 (0 terminated) */
- Str32 typeName; /* Max type name is 32 (0 terminated) */
- };
- typedef struct BSStoreInfo BSStoreInfo;
-
- typedef BSStoreInfo *BSStoreInfoPtr;
- /*
- ****************************************************************************
-
- BSContainerInfo is used to return information about a Container
-
- ***************************************************************************
- */
- struct BSContainerInfo {
- RegEntryRef device;
- ItemCount numChildren;
- Boolean ejectable;
- };
- typedef struct BSContainerInfo BSContainerInfo;
-
- typedef BSContainerInfo *BSContainerInfoPtr;
- /*
- ****************************************************************************
-
- BSPartitionInfo is used to return information about a Partition
-
- ***************************************************************************
- */
- struct BSPartitionDescriptor {
- ItemCount entryNum;
- BSByteCount start;
- BSByteCount len;
- BSStoreID destStoreID;
- Boolean isPartitionable;
- Boolean isFilesystem;
- Boolean reserved1;
- Boolean reserved2;
- Str255 name; /* Max name size is 255 (0 terminated) */
- Str32 typeName; /* Max type name is 32 (0 terminated) */
- };
- typedef struct BSPartitionDescriptor BSPartitionDescriptor;
-
- typedef BSPartitionDescriptor *BSPartitionDescriptorPtr;
- /*
- ****************************************************************************
-
- BSStoreComponent describes a component of a Store. A component may
- be an external device or another Store.
-
- ***************************************************************************
- */
- struct BSStoreComponent {
- BSComponentType componentType;
- BSByteCount startingOffset; /* Where in the Store this */
- /* component will be placed */
- RegEntryRef sourceNode; /* Physical components */
- BSStoreRef srcStore; /* Logical components */
- BSPartitionDescriptor partitionInfo; /* Logical components */
- };
- typedef struct BSStoreComponent BSStoreComponent;
-
- typedef BSStoreComponent *BSStoreComponentPtr;
- /*
- ****************************************************************************
-
- ***************************************************************************
- */
- struct BSStoreIOIteratorData {
- IOCommonInfo IOCI;
- BSStoreInfo info;
- };
- typedef struct BSStoreIOIteratorData BSStoreIOIteratorData;
-
- /*
- ****************************************************************************
- *****************************************************************************
- *****************************************************************************
-
- Block Storage API Functions
-
- These functions make up the Block Storage API. All functions are callable
- from the user or privileged bands. The API is split into the following
- sections:
-
- Navigation - operations to find a Store or Container and its
- relationship to other Stores and Containers
-
- Connections - operations to open and close connections with Stores and
- Containers
-
- Block Lists - operations to create and manipulate Block Lists, used
- as inputs for I/O operations
-
- I/O - operations to read and write date to Stores
-
- Accessibility - operations to change the accessibility of Store and
- Containers. Power-down and eject are handled via this interface
-
- Configuration - operations to add new devices, replace plug-ins,
- format and partition Stores and modify the relationships of
- Stores and Containers to each other.
-
- *****************************************************************************
- *****************************************************************************
- ***************************************************************************
- */
- /*
- ****************************************************************************
- *****************************************************************************
-
- Block Storage Navigation API
-
- *****************************************************************************
- ***************************************************************************
- */
- /*
- ******************************************************************************
-
- BSStoreGetDeviceData - a simple iteration model to retrieve all of the
- Stores, the leaf Stores or the primary Stores.
-
- Inputs: selector - which set of Stores to retrieve
- kBSStoreGetLeafStores retrieves leaf stores
- kBSStoreGetAllStores retrieves all stores
- kBSStoreGetPrimaryStores retrieves only primary stores
- requestItemCount - the size of the buffer
-
- Outputs: iteratorData - the array of BSStoreIOIteratorData structures
- to be filled in
- totalItemCount - the actual number of items available (may be
- more than requestItemCount, though only requestItemCount
- structures will be filled in in iteratorData)
-
- Returns: E_BSSuccess if successful
-
-
- *****************************************************************************
- */
- extern OSStatus BSStoreGetDeviceData(BSStoreGetSelector selector, ItemCount requestItemCount, ItemCount *totalItemCount, BSStoreIOIteratorData *iteratorData);
-
- /*
- ******************************************************************************
-
- BSStoreIteratorCreate - Creates an iterator for Block Storage Stores which
- will be initially placed on startingStore. If starting Store is NULL
- the iterator will be placed "in the soup" at the root of the Store
- hierarchy
-
- Inputs: startingStore - the Store to begin at
-
- Outputs: newIterator - the returned iterator
-
- Returns: E_BSSuccess if successful
-
-
- *****************************************************************************
- */
- extern OSStatus BSStoreIteratorCreate(BSStoreRef *startingStore, BSStoreIteratorID *newIterator);
-
- /*
- ******************************************************************************
-
- BSStoreIteratorDispose - disposes of an iterator, freeing all resources
- associated with it
-
- Inputs: disposeIterator - the iterator to dispose
-
- Outputs: <none>
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- extern OSStatus BSStoreIteratorDispose(BSStoreIteratorID disposeIterator);
-
- /*
- ******************************************************************************
-
- BSStoreIteratorEnter - Moves the iterator into the child the iterator is
- currently on, placing it on the first child
-
- Inputs: iterator - the iterator to move
-
- Outputs: newStore - the Store we've just exited
-
- Returns: E_BSSuccessful
-
- *****************************************************************************
- */
- extern OSStatus BSStoreIteratorEnter(BSStoreIteratorID iterator, BSStoreRef *newStore);
-
- /*
- ******************************************************************************
-
- BSStoreIteratorExit - Moves the iterator into the parent the iterator is
- currently on, placing the iterator on the Store it exited.
-
- Inputs: iterator - the iterator to move
-
- Outputs: newStore - the Store we've been placed on
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- extern OSStatus BSStoreIteratorExit(BSStoreIteratorID iterator, BSStoreRef *newStore);
-
- /*
- ******************************************************************************
-
- BSStoreIteratorRestartChildren - Places the iterator on the first child
- in the current Store
-
- Inputs: iterator - the iterator to restart
-
- Outputs: newChild - the child we've been placed on
-
- Returns: E_BSSuccess if succesful
-
- *****************************************************************************
- */
- extern OSStatus BSStoreIteratorRestartChildren(BSStoreIteratorID iterator, BSStoreRef *newChild);
-
- /*
- ******************************************************************************
-
- BSStoreIteratorRestartParent - Places the iterator on the first parent
- in the current Store
-
- Inputs: iterator - the iterator to restart
-
- Outputs: newParent - the parent we've been placed on
-
- Returns: E_BSSuccess if succesful
-
- *****************************************************************************
- */
- extern OSStatus BSStoreIteratorRestartParent(BSStoreIteratorID iterator, BSStoreRef *newParent);
-
- /*
- ******************************************************************************
-
- BSStoreIteratorNextChild - Moves the iterator to the next child
-
- Inputs: iterator - the iterator to move
-
- Outputs: newChild - the child we've been placed on
- changed - true if a parent or child has been added or deleted
- to this Store since the last BSStoreIteratorNextChild or
- BSStoreIteratorNextParent call
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- extern OSStatus BSStoreIteratorNextChild(BSStoreIteratorID iterator, BSStoreRef *newChild, Boolean *changed);
-
- /*
- ******************************************************************************
-
- BSStoreIteratorNextParent - Moves the iterator to the next parent
-
- Inputs: iterator - iterator to move
- changed - true if a parent or child has been added or deleted
- since the last BSStoreIteratorNextChild or
- BSStoreIteratorNextParent call
-
- Outputs: newParent - the parent we've been placed on
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- extern OSStatus BSStoreIteratorNextParent(BSStoreIteratorID iterator, BSStoreRef *newParent, Boolean *changed);
-
- /*
- ******************************************************************************
-
- BSContainerIteratorCreate - Creates an iterator for Block Storage Containers
- which will be initially placed on startingContainer. If starting
- Container is NULL the iterator will be placed "in the soup" at the root
- of the Container hierarchy.
-
- Inputs: startingContainer - the container to start at or NULL to start
- at the root of the Container hierarchy
-
- Outputs: newIterator - the created iterator
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- extern OSStatus BSContainerIteratorCreate(BSContainerRef *startingContainer, BSContainerIteratorID *newIterator);
-
- /*
- ******************************************************************************
-
- BSContainerIteratorDispose - disposes of an iterator, freeing all resources
- associated with it
-
- Inputs: disposeIterator - the iterator to dispose
-
- Outputs: <none>
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- extern OSStatus BSContainerIteratorDispose(BSContainerIteratorID disposeIterator);
-
- /*
- ******************************************************************************
-
- BSContainerIteratorEnter - Moves the iterator into the child the iterator is
- currently on, placing it on the first child
-
- Inputs: iterator - the iterator to move
-
- Outputs: newContainer - the Container we've been placed on
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- extern OSStatus BSContainerIteratorEnter(BSContainerIteratorID iterator, BSContainerRef *newContainer);
-
- /*
- ******************************************************************************
-
- BSContainerIteratorExit - exits to the parent of the current Container,
- placing the iterator on the Container it exited. (Containers may have
- only one parent)
-
- Inputs: iterator - the iterator to move
-
- Outputs: newContainer - the Container we've just exited
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- extern OSStatus BSContainerIteratorExit(BSContainerIteratorID iterator, BSContainerRef *newContainer);
-
- /*
- ******************************************************************************
-
- BSContainerIteratorRestartChildren - Places the iterator on the first child
- in the current Container
-
- Inputs: iterator - the iterator to restart
-
- Outputs: newChild - the child we've been placed on
-
- Returns: E_BSSuccess if succesful
-
- *****************************************************************************
- */
- extern OSStatus BSContainerIteratorRestartChildren(BSContainerIteratorID iterator, BSContainerRef *newChild);
-
- /*
- ******************************************************************************
-
- BSContainerIteratorNextChild - Moves the iterator to the next child
-
- Inputs: iterator - the iterator to move
-
- Outputs: newChild - the child we've been placed on
- changed - true if a child has been added or deleted to this
- Container since the last BSContainerIteratorNextChild.
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- extern OSStatus BSContainerIteratorNextChild(BSContainerIteratorID iterator, BSContainerRef *newChild);
-
- /*
- ******************************************************************************
-
- BSStoreFindByID - finds a Store by its identifier and returns a ref
-
- Inputs: storeID - the Store ID to find
-
- Outputs: foundStore - the found reference
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- extern OSStatus BSStoreFindByID(BSStoreID storeID, BSStoreRef *foundStore);
-
- /*
- ******************************************************************************
-
- BSStoreGetPropertySize - retrieves the size of the named property from the
- Store.
-
- Inputs: store - the Store to retrieve the property from
- propertyName - the name of the property to retrieve the size of
- propertyInstance - the instance of the property within this Store
-
- Outputs: propertySize - filled in with the size of the property
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- extern OSStatus BSStoreGetPropertySize(BSStoreRef *store, char *propertyName, BSStorePropertyInstance propertyInstance, ByteCount *propertySize);
-
- /*
- ******************************************************************************
-
- BSStoreGetProperty - retrieves the named property from the Store.
-
- Inputs: store - the Store to retrieve the property from
- propertyName - the name of the property to retrieve the size of
- propertyInstance - the instance of the property within this Store
- propertySize - the size of the buffer passed in (on input)
-
- Outputs: propertyValue - a pointer to the buffer to be filled in
- propertySize - the size filled in (on exit)
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- extern OSStatus BSStoreGetProperty(BSStoreRef *store, char *propertyName, BSStorePropertyInstance propertyInstance, void *propertyValue, ByteCount *propertySize);
-
- /*
- ******************************************************************************
-
- BSContainerGetPropertySize - retrieves the size of the named property from
- the Container.
-
- Inputs: container - the Container to retrieve the property from
- propertyName - the name of the property to retrieve the size of
- propertyInstance - the instance of the property within this Store
-
- Outputs: propertySize - filled in with the size of the property
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- extern OSStatus BSContainerGetPropertySize(BSContainerRef *container, char *propertyName, BSContainerPropertyInstance propertyInstance, ByteCount *propertySize);
-
- /*
- ******************************************************************************
-
- BSContainerGetProperty - retrieves the named property from the Container.
-
- Inputs: container - the Container to retrieve the property from
- propertyName - the name of the property to retrieve the size of
- propertyInstance - the instance of the property within this
- Container
- propertySize - the size of the buffer passed in (on input)
-
- Outputs: propertyValue - a pointer to the buffer to be filled in
- propertySize - the size filled in (on exit)
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- extern OSStatus BSContainerGetProperty(BSContainerRef *container, char *propertyName, BSContainerPropertyInstance propertyInstance, ByteCount *propertySize);
-
- /*
- ****************************************************************************
- *****************************************************************************
-
- Block Storage Connection Operations
-
- *****************************************************************************
- ***************************************************************************
- */
- /*
- ******************************************************************************
-
- BSStoreOpen - Opens a Connection to a Store
-
- Inputs: store - the Store to be opened
- options - options to the connection
-
- Outputs: newConnection - the created connection if successful
-
- Returns: E_BSSuccess on success
- E_BSOutOfResources if resources for the connection cannot be allocated
- E_BSStoreInUse if the Store has an exclusive connection or if an
- exclusive connection was requested to a Store with any connections
- open.
- E_BSStoreWriteProtected if Write access was requested to a read only
- Store
- E_BSStoreNotFound if store did not match any existing Stores
-
- *****************************************************************************
- */
- extern OSStatus BSStoreOpen(BSStoreRef *store, BSStoreOpenOptions options, BSStoreConnID *newConnection);
-
- /*
- ******************************************************************************
-
- BSStoreConnClose - closes a Connection to a Store
-
- Inputs: connection - the connection to be closed
-
- Outputs: <none>
-
- Returns: E_BSSuccess if successful
- E_BSBadConnection if the connection ID has problems
-
- *****************************************************************************
- */
- extern OSStatus BSStoreConnClose(BSStoreConnID connection);
-
- /*
- ******************************************************************************
-
- BSContainerOpen - Opens a Connection to a Container
-
- Inputs: container - the Container to be opened
- options - options to the connection
-
- Outputs: newConnection - the created connection if successful
-
- Returns: E_BSSuccess on success
- E_BSOutOfResources if resources for the connection cannot be allocated
- E_BSContainerInUse if the Container has an exclusive connection or if an
- exclusive connection was requested to a Container with any connections
- open.
- E_BSContainerNotFound if container did not match any existing Containers
-
- *****************************************************************************
- */
- extern OSStatus BSContainerOpen(BSContainerRef *container, BSContainerOpenOptions options, BSContainerConnID *newConnection);
-
- /*
- ******************************************************************************
-
- BSContainerConnClose - closes a Connection to a Container
-
- Inputs: connection - the connection to be closed
-
- Outputs: <none>
-
- Returns: E_BSSuccess if successful
- E_BSBadConnection if the connection ID has problems
-
- *****************************************************************************
- */
- extern OSStatus BSContainerConnClose(BSContainerConnID connection);
-
- /*
- ****************************************************************************
- *****************************************************************************
-
- Block Storage Block List Operations
-
- *****************************************************************************
- ***************************************************************************
- */
- /*
- ******************************************************************************
-
- BSBlockListCreate - Creates a block list for use with Block Storage
-
- Inputs: numAnticipatedRange - the number of ranges expected
-
- Outputs: newList - the new list to which ranges may be added
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- extern OSStatus BSBlockListCreate(ItemCount numAnticipatedRanges, BSBlockListRef *newList);
-
- /*
- ******************************************************************************
-
- BSBlockListAddRange - Appends a new range to an existing block list
-
- Inputs: appendList - the list to add the new range to
- startingOffset - the offset, in bytes on the device of the
- start of the range
- length - the length, in bytes, of the range
-
- Outputs: <none>
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- extern OSStatus BSBlockListAddRange(BSBlockListRef appendList, BSByteCount startingOffset, ByteCount length);
-
- /*
- ******************************************************************************
-
- BSBlockListFinalize - creates a descriptor to be used in a Block Storage
- read or write call from the memory list. After this call has been made
- no more ranges may be added to the list.
-
- Inputs: finalizeList - the list to be finalized
-
- Outputs: newDescriptor - the descriptor, to be used in a read/write call
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- extern OSStatus BSBlockListFinalize(BSBlockListRef finalizeList, BSBlockListDescriptorRef *newDescriptor);
-
- /*
- ******************************************************************************
-
- BSBlockListDelete - Removes a Block List. All resources
- associated with this Block List are relinquished. This includes memory
- which was prepared for any of its descriptors. All descriptors are
- invalidated. This call should only be used to clean-up Block Lists
- in an abort condition. In normal usage, use BSBlockListDescriptorDelete
- to remove all descriptors and free the Block List.
-
- Inputs: deleteList - the descriptor to delete
-
- Outputs: <none>
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- extern OSStatus BSBlockListDelete(BSBlockListRef deleteList);
-
- /*
- ******************************************************************************
-
- BSBlockListDescriptorDelete - Removes a Block List Descriptor. All resources
- associated with this descriptor are relinquished. This includes memory
- which was prepared for this descriptor. If this was the last descriptor
- for a BlockList the BlockList is free'd also.
-
- Inputs: deleteDescriptor - the descriptor to delete
-
- Outputs: <none>
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- extern OSStatus BSBlockListDescriptorDelete(BSBlockListDescriptorRef deleteDescriptor);
-
- /*
- ******************************************************************************
-
- BSBlockListDescriptorSeek - Changes the offset within the Block List descriptor
-
- Inputs: seekDescriptor - the descriptor to seek within
- whence - how to seek
- offset - where to seek
-
- Outputs: newOffset - what the current offset is now
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- extern OSStatus BSBlockListDescriptorSeek(BSBlockListDescriptorRef seekDescriptor, BSBlockListWhence whence, SInt64 offset, BSByteCount *newOffset);
-
- /*
- ******************************************************************************
-
- BSBlockListGetExtent - Gets an extent at the current offset for up to the
- specified length
-
- Inputs: srcDesriptor - the descriptor to get the extent from
- requestedLen - how long an extent to try to get
-
- Outputs: startingByte - the starting byte address in the device of the
- extent
- extentLen - how long an extent within the descriptor was found
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- extern OSStatus BSBlockListDescriptorGetExtent(BSBlockListDescriptorRef srcDescriptor, ByteCount requestedLen, BSByteCount *startingByte, ByteCount *extentLen);
-
- /*
- ******************************************************************************
-
- BSBlockListAddSimpleDescriptor - adds a new descriptor to a block list. The
- new descriptor begins at the current offset of the srcDescriptor. The
- offset of the srcDescriptor is updated to point at the first byte after
- the end of the new descriptor.
-
- Inputs: srcDescriptor - the descriptor to base the new descriptor upon
- length - how much the new descriptor should cover
- bias - the bias offset to be applied to the block address of
- srcDescriptor. When addresses are retrieve from newDescriptor
- bias will be added.
-
- Outputs: newDescriptor - the new descriptor
-
- Returns: E_BSSucess if successful
-
- *****************************************************************************
- */
- extern OSStatus BSBlockListAddSimpleDescriptor(BSBlockListDescriptorRef srcDescriptor, BSByteCount length, BSByteCount bias, BSBlockListDescriptorRef *newDescriptor);
-
- /*
- ******************************************************************************
-
- BSBlockListDescriptorGetInfo - returns information about the specified
- descriptor
-
- Inputs: infoDescriptor - the descriptor to get information about
-
- Outputs: info - the information
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- extern OSStatus BSBlockListDescriptorGetInfo(BSBlockListDescriptorRef infoDescriptor, BSBlockListDescriptorInfo *info);
-
- /*
- ******************************************************************************
-
- BSBlockListDescriptorCheckBlockSizes - checks the extents specified by the
- descriptor and ensures that all start at 0 mod blockSize and are
- 0 mod blockSize in length.
-
- Inputs: checkDescriptor - the descriptor to check
- blockSize - the block size to check for
-
- Outputs: <none>
-
- Returns: E_BSSuccess if successful
- E_BSBlockListBadBlockSize if any extents are mis-aligned
-
- *****************************************************************************
- */
- extern OSStatus BSBlockListDescriptorCheckBlockSizes(BSBlockListDescriptorRef checkDescriptor, UInt32 blockSize);
-
- /*
- ******************************************************************************
-
- BSBlockListDescriptorCheckBounds - checks the extents specified by the
- descriptor and ensures that none specify addresses beyond bound
-
- Inputs: checkDescriptor - the descriptor to check
- bound - the highest allowable address
-
- Outputs: <none>
-
- Returns: E_BSSuccess if successful
- E_BSBlockListBadBlockSize if any extents are mis-aligned
-
- *****************************************************************************
- */
- extern OSStatus BSBlockListDescriptorCheckBounds(BSBlockListDescriptorRef checkDescriptor, BSByteCount bound);
-
- /*
- ****************************************************************************
- *****************************************************************************
-
- Block Storage I/O Operations
-
- *****************************************************************************
- ***************************************************************************
- */
- /*
- ******************************************************************************
-
- BSStoreConnRead - reads data from the Store indicated by the Connection.
- This is the simple version of the call, taking only a single range
-
- Inputs: readConnection - the connection to the Store to be read from
- startingOffset - the 64-bit offset into the device to start the
- read at
- bytesToRead - the 32-bit, unsigned, number of bytes to read
-
- Outputs: buffer - filled in with the bytes read
-
- Returns: E_BSSuccess if successful
- E_BSBadConnection if the connection ID has problems
- E_BSMPIOutOfStoreBounds if the request exceeds the boundaries of
- the Store
- E_BSMPIUnitNotResponding if the device does not respond
- E_BSMPITransferError if some error was detected during the transfer
- E_BSMPIMemoryAccessFault if the destination memory was not accessible
- E_BSMPIOutOfResources if a necessary resource (usually memory) could
- not be allocated
- E_BSMPIMediaRemoved if the media was removed
-
- *****************************************************************************
- */
- extern OSStatus BSStoreConnRead(BSStoreConnID readConnection, BSByteCount startingOffset, ByteCount bytesToRead, void *buffer);
-
- /*
- ******************************************************************************
-
- BSStoreConnWrite - writes data to the Store a Connection indicates. This is
- the simple version of the call taking only a single range.
-
- Inputs: writeConnection - the connection to the Store to be read from
- srcMem - where the data is to be taken from
- destBlocks - the blocks on the Store where the data is to be placed
-
- Outputs: <none>
-
- Returns: E_BSSuccess if successful
- E_BSBadConnection if the connection ID has problems
- E_BSMPIOutOfStoreBounds if the request exceeds the boundaries of
- the Store
- E_BSMPIUnitNotResponding if the device does not respond
- E_BSMPITransferError if some error was detected during the transfer
- E_BSMPIMemoryAccessFault if the destination memory was not accessible
- E_BSMPIOutOfResources if a necessary resource (usually memory) could
- not be allocated
- E_BSMPIMediaRemoved if the media was removed
-
- *****************************************************************************
- */
- extern OSStatus BSStoreConnWrite(BSStoreConnID writeConnection, BSByteCount startingOffset, ByteCount bytesToWrite, void *buffer);
-
- /*
- ******************************************************************************
-
- BSStoreConnReadSG - reads data from the Store indicated by the Connection.
- This is the scatter/gather version of the call. The Block List is
- generated by the calls above, the Memory List calls can be found in
- <MemoryLists.h>.
-
- Inputs: readConnection - the connection to the Store to be read from
- srcBlocks - a descriptor indicating the ranges on the device
- to be read
- destMemory - a Memory List descriptor indicating where the
- data is to be placed
-
- Outputs: <none>
-
- Returns: E_BSSuccess if successful
- E_BSBadConnection if the connection ID has problems
- E_BSMPIOutOfStoreBounds if the request exceeds the boundaries of
- the Store
- E_BSMPIUnitNotResponding if the device does not respond
- E_BSMPITransferError if some error was detected during the transfer
- E_BSMPIMemoryAccessFault if the destination memory was not accessible
- E_BSMPIOutOfResources if a necessary resource (usually memory) could
- not be allocated
- E_BSMPIMediaRemoved if the media was removed
-
- *****************************************************************************
- */
- extern OSStatus BSStoreConnReadSG(BSStoreConnID readConnection, BSBlockListDescriptorRef srcBlocks, MemListDescriptorRef destMemory);
-
- /*
- ******************************************************************************
-
- BSStoreConnWriteSG - writes data to the Store a Connection indicates. This
- is the scatter/gather version of the call. The Block List is
- generated by the calls above, the Memory List calls can be found in
- <MemoryLists.h>.
-
- Inputs: writeConnection - the connection to the Store to be read from
- srcMem - where the data is to be taken from
- destBlocks - the blocks on the Store where the data is to be placed
-
- Outputs: <none>
-
- Returns: E_BSSuccess if successful
- E_BSBadConnection if the connection ID has problems
- E_BSMPIOutOfStoreBounds if the request exceeds the boundaries of
- the Store
- E_BSMPIUnitNotResponding if the device does not respond
- E_BSMPITransferError if some error was detected during the transfer
- E_BSMPIMemoryAccessFault if the destination memory was not accessible
- E_BSMPIOutOfResources if a necessary resource (usually memory) could
- not be allocated
- E_BSMPIMediaRemoved if the media was removed
-
- *****************************************************************************
- */
- extern OSStatus BSStoreConnWriteSG(BSStoreConnID writeConnection, MemListDescriptorRef srcMemory, BSBlockListDescriptorRef destBlocks);
-
- /*
- ******************************************************************************
-
- BSStoreConnReadAsync - reads data from the Store indicated by the Connection.
- This is the asynchronous version of the simple call, taking only a
- single range.
-
- Inputs: readConnection - the connection to the Store to be read from
- startingOffset - the 64-bit offset into the device to start the
- read at
- bytesToRead - the 32-bit, unsigned, number of bytes to read
- notification - how the calling app wishes to be notified
-
- Outputs: buffer - filled in with the bytes read
-
- Returns: E_BSSuccess if successful
- E_BSBadConnection if the connection ID has problems
- E_BSMPIOutOfStoreBounds if the request exceeds the boundaries of
- the Store
- E_BSMPIUnitNotResponding if the device does not respond
- E_BSMPITransferError if some error was detected during the transfer
- E_BSMPIMemoryAccessFault if the destination memory was not accessible
- E_BSMPIOutOfResources if a necessary resource (usually memory) could
- not be allocated
- E_BSMPIMediaRemoved if the media was removed
-
- *****************************************************************************
- */
- extern OSStatus BSStoreConnReadAsync(BSStoreConnID readConnection, BSByteCount startingOffset, ByteCount bytesToRead, KernelNotification *notification, void *buffer);
-
- /*
- ******************************************************************************
-
- BSStoreConnWriteAsync - writes data to the Store a Connection indicates.
- This is the asynchronous version of the simple call, taking only a
- single range.
-
- Inputs: writeConnection - the connection to the Store to be read from
- srcMem - where the data is to be taken from
- destBlocks - the blocks on the Store where the data is to be placed
- notification - how the caller wishes to be notified
-
- Outputs: bytesWritten - the number of bytes written
- (srcMem must remain a valid memory area until
- notification of completion is received)
-
- Returns: E_BSSuccess if successful
- E_BSBadConnection if the connection ID has problems
- E_BSMPIOutOfStoreBounds if the request exceeds the boundaries of
- the Store
- E_BSMPIUnitNotResponding if the device does not respond
- E_BSMPITransferError if some error was detected during the transfer
- E_BSMPIMemoryAccessFault if the destination memory was not accessible
- E_BSMPIOutOfResources if a necessary resource (usually memory) could
- not be allocated
- E_BSMPIMediaRemoved if the media was removed
-
- *****************************************************************************
- */
- extern OSStatus BSStoreConnWriteAsync(BSStoreConnID writeConnection, BSByteCount startingOffset, ByteCount bytesToWrite, KernelNotification *notification, void *buffer);
-
- /*
- ******************************************************************************
-
- BSStoreConnReadSGAsync - reads data from the Store indicated by the Connection.
- This is the asynchronous version of the scatter/gather call.
- The Block List is generated by the calls above, the Memory List calls
- can be found in <MemoryLists.h>.
-
- Inputs: readConnection - the connection to the Store to be read from
- srcBlocks - a descriptor indicating the ranges on the device
- to be read
- destMemory - a Memory List descriptor indicating where the
- data is to be placed
- notification - how the caller wishes to be notified
-
- Outputs: <none>
-
- Returns: E_BSSuccess if successful
- E_BSBadConnection if the connection ID has problems
- E_BSMPIOutOfStoreBounds if the request exceeds the boundaries of
- the Store
- E_BSMPIUnitNotResponding if the device does not respond
- E_BSMPITransferError if some error was detected during the transfer
- E_BSMPIMemoryAccessFault if the destination memory was not accessible
- E_BSMPIOutOfResources if a necessary resource (usually memory) could
- not be allocated
- E_BSMPIMediaRemoved if the media was removed
-
- *****************************************************************************
- */
- extern OSStatus BSStoreConnReadSGAsync(BSStoreConnID readConnection, BSBlockListDescriptorRef srcBlocks, MemListDescriptorRef destMemory, KernelNotification *notification);
-
- /*
- ******************************************************************************
-
- BSStoreConnWriteSGAsync - writes data to the Store a Connection indicates.
- This is the asynchronous version of the scatter/gather call. The
- Block List is generated by the calls above, the Memory List calls can
- be found in <MemoryLists.h>.
-
- Inputs: writeConnection - the connection to the Store to be read from
- srcMem - where the data is to be taken from
- (the memory areas indicated by srcMem must remain valid until
- notification is received)
- destBlocks - the blocks on the Store where the data is to be placed
- notification - how the caller wishes to be notified of completion
-
- Outputs: <none>
-
-
- Returns: E_BSSuccess if successful
- E_BSBadConnection if the connection ID has problems
- E_BSMPIOutOfStoreBounds if the request exceeds the boundaries of
- the Store
- E_BSMPIUnitNotResponding if the device does not respond
- E_BSMPITransferError if some error was detected during the transfer
- E_BSMPIMemoryAccessFault if the destination memory was not accessible
- E_BSMPIOutOfResources if a necessary resource (usually memory) could
- not be allocated
- E_BSMPIMediaRemoved if the media was removed
-
- *****************************************************************************
- */
- extern OSStatus BSStoreConnWriteSGAsync(BSStoreConnID writeConnection, MemListDescriptorRef srcMemory, BSBlockListDescriptorRef destBlocks, KernelNotification *notification);
-
- /*
- ******************************************************************************
-
- BSStoreConnFlush - Flushes caches for this Store and any Stores this Store
- is derived from.
-
- Inputs: flushConnection - the connection to the Store to be flushed
-
- Outputs: <none>
-
-
- Returns: E_BSSuccess if successful
- E_BSBadConnection if the connection ID has problems
- E_BSMPIUnitNotResponding if the device does not respond
- E_BSMPITransferError if some error was detected during the transfer
- E_BSMPIMemoryAccessFault if the destination memory was not accessible
- E_BSMPIOutOfResources if a necessary resource (usually memory) could
- not be allocated
- E_BSMPIMediaRemoved if the media was removed
-
- *****************************************************************************
- */
- extern OSStatus BSStoreConnFlush(BSStoreConnID flushConnection);
-
- /*
- ****************************************************************************
- *****************************************************************************
-
- Block Storage Accessibility Operations
-
- *****************************************************************************
- ***************************************************************************
- */
- /*
- ******************************************************************************
-
- BSStoreConnGoToAccessibilityState - requests that a Store change its
- accessibility state to the one desired
-
- Inputs: connection - connection to the Store to change state
- newState - the desired state
-
- Outputs: <none>
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- extern OSStatus BSStoreConnGoToAccessibilityState(BSStoreConnID connection, BSAccessibilityState newState);
-
- /*
- ******************************************************************************
-
- BSContainerConnGoToAccessibilityState - requests that a Container change
- its accessibility state to the one desired
-
- Inputs: connection - connection to the Container to change state
- newState - the desired state
-
- Outputs: <none>
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- extern OSStatus BSContainerConnGoToAccessibilityState(BSContainerConnID connection, BSAccessibilityState newState);
-
- /*
- ****************************************************************************
- *****************************************************************************
-
- Block Storage Configuration
-
- *****************************************************************************
- ***************************************************************************
- */
- /*
- ******************************************************************************
-
- BSStoreConnGetInfo - gets information about the Store a Connection indicates
-
- Inputs: infoConnection - the connection to the Store we want info about
-
- Outputs: infoBuffer - the information about the Store
-
- Returns: E_BSSuccess if successful
- E_BSBadConnection if the connection ID has problems
-
- *****************************************************************************
- */
- extern OSStatus BSStoreConnGetInfo(BSStoreConnID infoConnection, BSStoreInfo *infoBuffer);
-
- /*
- ******************************************************************************
-
- BSStoreCreate - creates a new Store. The Store is not added into the Block
- Storage Name Store hierarchy.
-
- Inputs: <none>
-
- Outputs: newStore - the ID of the new Store
- newStoreConnection - a connection to the created Store
-
- Returns: E_BSSuccess on success
- E_BSENoMoreStores if no more Stores can be allocated
- E_BSOutOfResources if other resources cannot be allocated
-
- *****************************************************************************
- */
- extern OSStatus BSStoreCreate(BSStoreID *newStore, BSStoreConnID *newStoreConnection);
-
- /*
- ******************************************************************************
-
- BSStoreConnDeleteAndClose - deletes the Store the current connection
- references and closes the connection
-
- Inputs: connection - the connection to the Store to be deleted
-
- Outputs: <none>
- Returns: E_BSSuccess on success
- E_BSStoreInUse if other connections are open to the Store
-
- *****************************************************************************
- */
- extern OSStatus BSStoreConnDeleteAndClose(BSStoreConnID connection);
-
- /*
- ******************************************************************************
-
- BSStoreConnSetPartitionInfo - Sets data in a partition map entry on a Store
-
- Inputs: storeConnection - the connection to the Store
- partitionNum - the partition map entry to be set
- partitionInfo - a pointer to the new partition map entry info
-
- Returns: E_BSSuccess if successful
- E_BSBadConnection if the connection ID has problems
- E_BSPPINoPlugIn if the Store does not have a Partitioning Plug-in
- E_BSPPIOverlappingPartition if the requested partition overlaps
- another
- E_BSPPIOutOfStoreBounds if the request partition exceeds the limits
- of the Store
-
- *****************************************************************************
- */
- extern OSStatus BSStoreConnSetPartitionInfo(BSStoreConnID storeConnection, ItemCount partitionNum, BSPartitionDescriptor *partitionInfo);
-
- /*
- ******************************************************************************
-
- BSStoreConnSetPartitionInfo - Gets data in a partition map entry on a Store
-
- Inputs: storeConnection - the connection to the Store
- partitionNum - the partition map entry to be retrieved
- partitionInfo - a pointer to the partition map entry info buffer
-
- Returns: E_BSSuccess if successful
- E_BSBadConnection if the connection ID has problems
- E_BSPPINoPlugIn if the Store does not have a Partitioning Plug-in
-
- *****************************************************************************
- */
- extern OSStatus BSStoreConnGetPartitionInfo(BSStoreConnID connection, ItemCount partitionNum, BSPartitionDescriptor *partitionInfo);
-
- /*
- ******************************************************************************
-
- BSStoreConnMapPartition - Maps a partition from a Store onto another Store
-
- Inputs: srcConnection - the connection to the source Store
- partitionNum - the partition to be mapped
- destConnection - the connection to the destination Store
- destStartingBlock - where in the destination Store the mapped
- partition should be placed
-
- Returns: E_BSSuccess if successful
- E_BSBadConnection if the connection ID has problems
- E_BSPPINoPlugIn if the Store does not have a Partitioning Plug-in
- E_BSPPIMappingNotSupported if the mapping is not supported by either
- Store
- E_BSPPIPartitionNonExistant if the source partition doesn't exist
- E_BSEHierarchyTooDeep if this would create too many layers in the
- hierarchy (currently limited to 8)
- *****************************************************************************
- */
- extern OSStatus BSStoreConnMapPartition(BSStoreConnID srcConnection, ItemCount partitionNum, BSStoreConnID destConnection, BSByteCount startingByte);
-
- /*
- ******************************************************************************
-
- BSStoreConnGetComponents - Gets the components of a Store.
-
- Inputs: connection - the connection to the Store
- tableSize - size of the table to be filled in
- componentInfo - a pointer to an array of BSStoreComponentInfos
- to be filled in
-
- Returns: E_BSSuccess if successful
- E_BSBadConnection if the connection ID has problems
- *****************************************************************************
- */
- extern OSStatus BSStoreConnGetComponents(BSStoreConnID connection, ItemCount tableSize, BSStoreComponent *componentInfo);
-
- /*
- ******************************************************************************
-
- BSStoreConnMapDevice - Maps an entire device into a Store
-
- Inputs: srcDevice - the Name Registry ID of the device
- destConnection - the connection to the destination Store
-
- Returns: E_BSSuccess if successful
- E_BSBadConnection if the connection ID has problems
- *****************************************************************************
- */
- extern OSStatus BSStoreConnMapDevice(RegEntryRef srcDevice, BSStoreConnID destConnection);
-
- /*
- ******************************************************************************
-
- BSStoreConnAssociateMappingPlugin - Attaches a Mapping Plug-in to a Store
-
- Inputs: connection - the connection to the Store
- mappingPlugin - the identifier of the Plugin to be attached
- Returns: E_BSSuccess if successful
- E_BSBadConnection if the connection ID has problems
- E_BSEPlugInNotFound if the plugin specified can't be found
- *****************************************************************************
- */
- extern OSStatus BSStoreConnAssociateMappingPlugin(BSStoreConnID connection, BSMappingPlugInRef mappingPlugin);
-
- /*
- ******************************************************************************
-
- BSStoreConnAssociatePartitioningPlugin - Attaches a Partitioning Plug-in to
- a Store
-
- Inputs: connection - the connection to the Store
- mappingPlugin - the identifier of the Plugin to be attached
- Returns: E_BSSuccess if successful
- E_BSBadConnection if the connection ID has problems
- E_BSEPlugInNotFound if the plugin specified can't be found
- *****************************************************************************
- */
- extern OSStatus BSStoreConnAssociatePartitioningPlugin(BSStoreConnID connection, BSPartitioningPlugInRef mappingPlugin);
-
- /*
- ******************************************************************************
-
- BSStoreConnPublish - makes a Store available for general use
-
- Inputs: connection - the connection to the Store
- Returns: E_BSSuccess if successful
- E_BSBadConnection if the connection ID has problems
- *****************************************************************************
- */
- extern OSStatus BSStoreConnPublish(BSStoreConnID connection);
-
- /*
- ******************************************************************************
-
- BSStoreConnUnpublish - removes a Store from general use
-
- Inputs: connection - the connection to the Store
- Returns: E_BSSuccess if successful
- E_BSBadConnection if the connection ID has problems
- *****************************************************************************
- */
- extern OSStatus BSStoreConnUnpublish(BSStoreConnID connection);
-
- /*
- ******************************************************************************
-
- BSStoreConnFormat - formats a Store in the specified format
-
- Inputs: connection - the connection to the Store
- formatType - the format number from possibleFormats in the
- BSStoreInfo structure
-
- Returns: E_BSSuccess if successful
- E_BSBadConnection if the connection ID has problems
- *****************************************************************************
- */
- extern OSStatus BSStoreConnFormat(BSStoreConnID connection, BSFormatIndex formatType);
-
- /*
- ******************************************************************************
-
- BSContainerConnGetInfo - gets information about the Container a Connection indicates
-
- Inputs: infoConnection - the connection to the Container we want info about
-
- Outputs: infoBuffer - the information about the Container
-
- Returns: E_BSSuccess if successful
- E_BSBadConnection if the connection ID has problems
-
- *****************************************************************************
- */
- extern OSStatus BSContainerConnGetInfo(BSContainerConnID infoConnection, BSContainerInfo *infoBuffer);
-
- /*
- ******************************************************************************
-
- BSContainerCreate - Creates a new Container. The Container is not added
- into the Block Storage Container Hierarchy
-
- Inputs: <none>
-
- Outputs: newContainer - a connection to the newly created Container
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- extern OSStatus BSContainerCreate(BSContainerConnID *newContainer);
-
- /*
- ******************************************************************************
-
- BSContainerConnDeleteAndClose - deletes the Container and closes the
- connection to it. No other connections to the Container may be open.
-
- Inputs: deleteContainer - connection to the Container to be deleted
-
- Outputs: <none>
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- extern OSStatus BSContainerConnDeleteAndClose(BSContainerConnID deleteContainer);
-
- /*
- ******************************************************************************
-
- BSContainerConnInsertContainer - inserts a Container into another Container
-
- Inputs: destContainer - a connection to the Container to insert into
- insertContainer - connection to the Container to be inserted
-
- Outputs: <none>
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- extern OSStatus BSContainerConnInsertContainer(BSContainerConnID destContainer, BSContainerConnID putContainer);
-
- /*
- ******************************************************************************
-
- BSContainerConnPublish - makes a Container available for use. Generates
- notifications as necessary
-
- Inputs: publishContainer - connection to the Container to be published
-
- Outputs: <none>
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- extern OSStatus BSContainerConnPublish(BSContainerConnID publishContainer);
-
- /*
- ******************************************************************************
-
- BSContainerConnUnpublish - removes a Container from general accessibility,
- does not delete it. The Container must not have any open connections or
- published children.
-
- Inputs: unpublishContainer - the Container to unpublish
-
- Outputs: <none>
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- extern OSStatus BSContainerConnUnpublish(BSContainerConnID unpublishContainer);
-
- /*
- ******************************************************************************
-
- BSContainerConnSetDevice - sets the device the Container plug-in will
- associate with. Should be called before BSContainerConnAssociatePlugIn
- for bare Containers.
-
- Inputs: connection - a connection to the Container we're associating
- the plug-in with
- deviceNode - the device the Container plug-in will interact with
-
- Outputs: <none>
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- extern OSStatus BSContainerConnSetDevice(BSContainerConnID connection, RegEntryRef deviceNode);
-
- /*
- ******************************************************************************
-
- BSContainerConnAssociatePlugIn - Associates a Container plug-in with a
- Container
-
- Inputs: connection - a connection to the Container we're associating
- the plug-in with
- plugIn - the new plug in to be associated
-
- Outputs: <none>
-
- Returns: E_BSSuccess if successful
-
- *****************************************************************************
- */
- extern OSStatus BSContainerConnAssociatePlugIn(BSContainerConnID connection, BSContainerPlugInRef plugIn);
-
- #endif
-
- #pragma options align=reset
- #endif /* PRAGMA_ALIGN_SUPPORTED */
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import off
- #endif
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* __BLOCKSTORAGE__ */
-
-